package com.flurry.android;

import com.flurry.android.responses.AppCloudError;
import com.flurry.android.responses.AppCloudSearchResultCompletionHandler;
import java.util.ArrayList;

final class fa
  implements AppCloudResponseHandler
{
  fa(AppCloudSearch paramAppCloudSearch, boolean paramBoolean, String paramString, AppCloudSearchResultCompletionHandler paramAppCloudSearchResultCompletionHandler)
  {
  }

  public final void handleResponse(AppCloudResponse paramAppCloudResponse)
    throws Exception
  {
    dn localdn = new dn(paramAppCloudResponse, Boolean.valueOf(this.gJ));
    ArrayList localArrayList = new ArrayList();
    if (localdn.isSuccessful())
    {
      long l = System.currentTimeMillis();
      if (this.gJ)
        for (int k = 0; k < localdn.getUsers().size(); k++)
        {
          AppCloudUser localAppCloudUser = (AppCloudUser)localdn.getUsers().get(k);
          localAppCloudUser.saveToCache();
          localArrayList.add(localAppCloudUser);
        }
      for (int i = 0; i < localdn.getObjects().size(); i++)
      {
        AppCloudObject localAppCloudObject = (AppCloudObject)localdn.getObjects().get(i);
        localAppCloudObject.p(AppCloudSearch.a(this.gq));
        localArrayList.add(localAppCloudObject);
      }
      String str1 = AppCloudSearch.c(this.gq).addItem(this.gK, AppCloudSearch.a(this.gq), l);
      boolean bool = this.gJ;
      int j = 0;
      if (bool)
        while (j < localdn.getUsers().size())
        {
          String str3 = ((AppCloudUser)localdn.getUsers().get(j)).getId();
          AppCloudSearch.d(this.gq).addItem(str1, str3, l);
          j++;
        }
      while (j < localdn.getObjects().size())
      {
        String str2 = ((AppCloudObject)localdn.getObjects().get(j)).getId();
        AppCloudSearch.d(this.gq).addItem(str1, str2, l);
        j++;
      }
      this.gL.onOperationSucceed(localArrayList.toArray());
      return;
    }
    this.gL.onError(new AppCloudError(paramAppCloudResponse.getHTTPResponseCode(), paramAppCloudResponse.getResponseMessage()));
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.flurry.android.fa
 * JD-Core Version:    0.6.2
 */